package com.czk.provider;

import com.czk.pojo.Protocol;
import com.czk.pojo.URL;
import com.czk.register.ZookeeperRegister;
import com.czk.server.NettyProtocol;
import com.czk.service.CallService;
import com.czk.service.impl.CallServiceImpl;
import com.czk.utils.ServerServiceCache;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/8/20 11:18
 */
public class Provider {
    public static void main(String[] args) {
        // 注册
        ServerServiceCache.register(CallService.class.getName(), CallServiceImpl.class);
        // 远程注册
        ZookeeperRegister.register(CallService.class.getName(), new URL("localhost", 7879));
        // 启动服务
        Protocol protocol = new NettyProtocol();
        // 启动
        protocol.start(new URL("localhost", 7879));
    }
}
